<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>我的</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="../../plugins/mui/mui.min.css">
		<script src="../../js/statistics.js"></script>
		<style type="text/css">
			 *{
            box-sizing: border-box;
            font-family: 'Microsoft YaHei';
	        }
	        body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, form,  input, p, table, th, td ,select,option{
	            padding: 0;
	            margin: 0;
	            list-style: none;
	        }
	        body{
	        	padding-top:45px;
	        	padding-bottom:10px;
	        }
			/*title的样式覆盖*/
			.mui-bar{
				background-color:#43ac45;
				top:0;
			}
			.mui-bar>a{
				color:#fff;
			}
			.mui-title{
				color:#fff;
			}
			/*列表数字角标移动防止盖住右箭头*/
			.mui-table-view-cell>.mui-badge{
				right:10.6%;
			}
				
			.mui-table-view{
				margin-top:10px;
			}
			.mui-navigate-right{
				line-height: 22px;
				font-size: 15px;
			}
			.icon1{
				width:21px;
				height:21px;
				float:left;
				margin-right:2.66%;
				/*vertical-align: middle;*/
				display:block;
			}
			.mui-badge-red{
				background-color:#ef113a;
			}
			.icon2>li>a>img{
				width:59px;
				height:59px;
				margin-right:7.4%;
			}
			.icon2>li>a{
				line-height:59px;
				font-size: 16px;
			}
			.icon2>li>span{
				position: absolute;
				top: 50%;
				right: 13.3%;
				-webkit-transform: translateY(-50%);
				width:26px;
				height:26px;
				background:url('../../images/my/index/erweima.png') no-repeat center center;
				background-size: cover;
			}
			.mui-table-view:before{
				display:none;
			}
			.mui-table-view:after{
				display:none;
			}
			.mui-table-view-cell:after{
				background-color:#e5e5e5;
			}
			
			/*百分比优化*/
			.mui-table-view-cell {
				padding: 11px 4%;
			}
			.mui-table-view-cell>a:not(.mui-btn){
				margin: -11px -4%;
			}
			.mui-navigate-right:after, .mui-push-right:after {
				right: 4%;
				
			}
			
			.mui-btn{
				display:block;
				width:100%;
				padding-left: 0%;
				padding-right: 0%;
				margin:0 auto;
				height:45px;
				border-radius: 0;
				position:absolute;
				bottom:0;
				background-color: #ee3b30;
				border-color:#ee3b30;
				font-size: 15px;
			}
		</style>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">设置</h1>
		</header>
		
		<ul class="mui-table-view">
		    <li class="mui-table-view-cell" id='alert1'>
		        <a class="mui-navigate-right">
		        	消息提示
		        </a>
				<!--<span class="mui-badge mui-badge-red">11</span>-->
		    </li>
		   
		    <li class="mui-table-view-cell" id='password1'>
		        <a class="mui-navigate-right">
		        	修改密码
		        </a>
		        <!--<span class="mui-badge mui-badge-red">11</span>-->
		    </li>
		</ul>
		
		<ul class="mui-table-view">
		    <li class="mui-table-view-cell" id='post1'>
		        <a class="mui-navigate-right">
		        	意见反馈
		        </a>
				<!--<span class="mui-badge mui-badge-red">11</span>-->
		    </li>
		   
		    <li class="mui-table-view-cell" id="about1">
		        <a class="mui-navigate-right">
		        	关于
		        </a>
		        <!--<span class="mui-badge mui-badge-red">11</span>-->
		    </li>
		</ul>
		<button type="button" class="mui-btn mui-btn-success" id='submit1'>退出登录</button>
		<script type="text/javascript" src="../../plugins/jquery/jquery-3.1.0.min.js"></script>
		<script src="../../plugins/mui/mui.min.js"></script>
		<!--<script type="text/javascript" src="../plugins/mui/update.js"></script>-->
		<script type="text/javascript">
			mui.init({
// 				statusBarBackground: '#43ac45',//ios下设置顶部背景色
	  		});
	  		mui.plusReady(function() {
				  //关闭等待框
				plus.nativeUI.closeWaiting();
				    //显示当前页面
				mui.currentWebview.show('slide-in-right',200);
				$('#submit1').click(function(){
						plus.nativeUI.confirm('确定退出当前用户吗',function(event){
						if(event.index){
							var a=['life_wx','life_hq','life_wl','life_kd','life_tq','life_jy','life_gh','life_zx','life_bj','pay_hf','trave_qc','trave_hc','trave_fj','trave_gj','trave_dd','trave_wf','trave_nc']
							var b=[];
							//讲外部链接的访问数据保存
							for(var i=0;i<a.length;i++){
								if(plus.storage.getItem(a[i])=='ture'){
									b[a[i]]='ture';
								}else{
									b[a[i]]='false';
								}
							}
							plus.storage.clear();//退出登陆 数据清空
							//保存版本号
							plus.runtime.getProperty(plus.runtime.appid,function(inf){
								wgtVer=inf.version;
								plus.storage.setItem('old_wgtVer',wgtVer);
								console.log(wgtVer);
								console.log('页面时登陆页');
							});
							plus.storage.setItem('cg_uuid',plus.device.uuid);//添加数据,启动页
							//讲外部链接的访问数据恢复
							for(var k in b){
								plus.storage.setItem(k,b[k]);
							}
							//ios打开
//							and();
							//安卓打开
							plus.io.resolveLocalFileSystemURL( "_doc/userImg/", function( entry ) {
								// 可通过entry对象操作test.html文件
								var directoryReader =  entry.createReader();
								directoryReader.readEntries( function( entries ){
//									var i;
									for( i=0; i < entries.length; i++ ) {
										entries[i].remove();//遍历每个图片删除
									}
									// 获取所有Webview窗口
									var curr = plus.webview.currentWebview();
									var wvs = plus.webview.all();
									var main = plus.webview.getWebviewById('index_menu.html');
									plus.webview.close(main);
									plus.webview.open('../login/login.html');
									curr.close();
								}, function ( e ) {
									alert( "Read entries failed: " + e.message );
								} );
							}, function ( e ) {
								alert( "Resolve file URL failed: " + e.message );
							} );

						}
					},'提醒',['取消','确定'])
				})
				//安卓打开 ios关闭
				function and(){
					var curr = plus.webview.currentWebview();
					var wvs = plus.webview.all();
					var main = plus.webview.getWebviewById('index_menu.html');
					plus.webview.close(main);
					plus.webview.open('../login/login.html');
					curr.close();
				}
			});
				
			
//				 document.getElementById("logout").addEventListener("tap", function() {
//					var btnArray = ['是', '否'];
//					mui.confirm('您确定退出?', '', btnArray, function(e) {
//					if (e.index == 0) {
//					loginx.LogOut(function() {
//					if (mui.os.ios || mui.os.ipad || mui.os.iphone) {
//					// 获取所有Webview窗口
//					var curr = plus.webview.currentWebview();
//					var wvs = plus.webview.all();
//					for (var i = 0, len = wvs.length; i < len; i++) {
//					//关闭除setting页面外的其他页面
//					if (wvs[i].getURL() == curr.getURL())
//					continue;
//					plus.webview.close(wvs[i]);
//					}
//					//打开login页面后再关闭setting页面
//					plus.webview.open('../login/login.html');
//					curr.close();
//					} else
//					plus.runtime.quit();
//					});
//					}
//					})
//					});
//					转自【B5教程网】:http://www.bcty365.com/content-146-2484-1.html
				 
				 
				 
				 
				 
				 
				 
				 
				 //消息提醒
				 alert1.addEventListener("tap",function () {
				  	mui.openWindow({
					    url:'seting-1.html',
					    id:'seting-1.html',
					     show:{
						      autoShow:false,//页面loaded事件发生后自动显示，默认为true
						      duration:200//页面动画持续时间，Android平台默认100毫秒，iOS平台默认200毫秒；
						},
						 waiting:{
					      	title:'正在加载...'//等待对话框上显示的提示内容
					      }
					})
				});
	  		
				password1.addEventListener("tap",function () {
				  	mui.openWindow({
					    url:'seting-2.html',
					    id:'seting-2.html',
					     show:{
						      autoShow:false,//页面loaded事件发生后自动显示，默认为true
						      duration:200//页面动画持续时间，Android平台默认100毫秒，iOS平台默认200毫秒；
						},
						 waiting:{
					      	title:'正在加载...'//等待对话框上显示的提示内容
					      }
					})
				});
				
				post1.addEventListener("tap",function () {
				  	mui.openWindow({
					    url:'seting-3.html',
					    id:'seting-3.html',
					     show:{
						      autoShow:false,//页面loaded事件发生后自动显示，默认为true
						      duration:200//页面动画持续时间，Android平台默认100毫秒，iOS平台默认200毫秒；
						},
						 waiting:{
					      	title:'正在加载...'//等待对话框上显示的提示内容
					      }
					})
				});
				about1.addEventListener("tap",function () {
				  	mui.openWindow({
					    url:'seting-4.html',
					    id:'seting-4.html',
					     show:{
						      autoShow:true,//页面loaded事件发生后自动显示，默认为true
						      duration:200//页面动画持续时间，Android平台默认100毫秒，iOS平台默认200毫秒；
						},
						 waiting:{
					      	title:'正在加载...'//等待对话框上显示的提示内容
					      }
					})
				});
		</script>
	</body>
</html>
